package com.daz.manager.statistics.action;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;

import com.daz.common.publicDict.pojo.publicDictPojo;
import com.daz.common.publicDict.server.IPublicDictServer;
import com.daz.manager.statistics.pojo.Statistics;
import com.daz.manager.statistics.server.IStatisticsServer;
import com.opensymphony.xwork2.ActionSupport;

public class StatisticsAction extends ActionSupport{
	@Autowired
	public IStatisticsServer statisticsServer;
	@Autowired
	public IPublicDictServer publicDictServer;
	public String prom;
	public String startTime;
	public String endTime;
	public String teacherName;
	public List<Statistics> resultList;
	public String selectById(){
		Map<String, Object> map = new HashMap<String, Object>();
		if(prom != null && !"".equals(prom)){
			map.put("prom", prom);
		}
		if(startTime != null && !"".equals(startTime)){
			map.put("startTime", startTime.substring(0,10));
		}
		if(endTime != null && !"".equals(endTime)){
			map.put("endTime", endTime.substring(0,10));
		}
		if(teacherName != null && !"".equals(teacherName)){
			map.put("teacherName", teacherName);
		}	
		try {
			resultList = statisticsServer.selectById(map);
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return SUCCESS;
	}
	public String getProm() {
		return prom;
	}
	public void setProm(String prom) {
		this.prom = prom;
	}
	public List<Statistics> getResultList() {
		return resultList;
	}
	public void setResultList(List<Statistics> resultList) {
		this.resultList = resultList;
	}
	public String getStartTime() {
		return startTime;
	}
	public void setStartTime(String startTime) {
		this.startTime = startTime;
	}
	public String getEndTime() {
		return endTime;
	}
	public void setEndTime(String endTime) {
		this.endTime = endTime;
	}
	public String getTeacherName() {
		return teacherName;
	}
	public void setTeacherName(String teacherName) {
		this.teacherName = teacherName;
	}
	
}
